{$form.javascript}
<form {$form.attributes}>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="form">
    <thead>
    <tr>
      <td colspan="4">
	  	<strong>{t}Invoice details{/t}</strong>
        <input type="hidden" name="formSubmitted" value="" />
        <input type="hidden" name="port_tva_rate" value="{$port_tva_rate|default:'0'}" />
        <input type="hidden" name="packing_tva_rate" value="{$packing_tva_rate|default:'0'}" />
        <input type="hidden" name="insurance_tva_rate" value="{$insurance_tva_rate|default:'0'}" />
        <input type="hidden" name="tvaSurtaxRate" value="{$TvaSurtaxRate}" id="tvaSurtaxRate" />
        <input type="hidden" name="fodecTaxRate" value="{$FodecTaxRate}" />
          <input type="hidden" name="taxStamp" value="{$TaxStamp}" />
        <!--<input type="hidden" name="HiddenRemExcep" value="{$remExcep}" />-->
        {$form.hidden}
	  </td>
	</tr>
	</thead>
	<tbody>
    <tr>
      <td width="25%"><strong>{$form.cmdNumber.label} : </strong></td>
      <td width="25%">{$form.cmdNumber.html}</td>
      <td width="25%"><strong>{$form.invoiceDocumentNo.label} : </strong></td>
      <td width="25%">{$form.invoiceDocumentNo.html}</td>
    </tr>
    <tr>
      <td><b>{t}Supplier{/t} : </b></td>
      <td>{$supplierName}</td>
      <td><b>{t}Customer{/t} : </b></td>
      <td>{$customerName}</td>
    </tr>
    <tr>
      <td><b>{$form.SupplierSite.label} : </b></td>
      <td>{$form.SupplierSite.html}</td>
      <td><b>{$form.CustomerSite.label} : </b></td>
      <td>{$form.CustomerSite.html}</td>
    </tr>
	<tr>
      <td><b>{t}Current outstanding debts{/t} (en {$Currency}): </b></td>
	  <td><input type="text" size="15" name="UpdateIncur" value="{$UpdateIncur}"
	  		readonly="readonly" class="ReadOnlyField" style="width:100%;" />
        	<input type="hidden" name="HiddenUpdateIncur" value="{$UpdateIncur}" style="width:100%;" />
	  </td>
	  <td><b>{$form.Commercial.label} : </b></td>
	  <td>{$form.Commercial.html}</td>
	</tr>
	<tr>
  		<td><b>{t}Maximum outstanding debts{/t} ({$Currency}): </b></td>
		<td><input type="text" size="15" name="MaxIncur" value="{$MaxIncur}"
			readonly="readonly" class="ReadOnlyField" style="width:100%;" /></td>
  		<td><strong>{t}Wished date{/t}*</strong></td>
		<td><span id="show_Date1" style="background-color:#E1E8EF;border:1px #000000 dotted;
			margin: 3px 3px 3px 3px;padding: 3px 3px 3px 3px;text-align: right;">--
            {t}Select a date{/t} --</span>
            <input type="hidden" name="StartDate" id="f_date_c1" />
            &nbsp;<input type="button" name="f_trigger_c1" id="f_trigger_c1" value="..."
                style="cursor: pointer;" title="{t}Select a date{/t}" />
{literal}
<script type="text/javascript">
// <![CDATA[
Calendar.setup({
	inputField     :    "f_date_c1",          // id of the input field (hidden)
    ifFormat       :    "%Y-%m-%d %H:%M:00",  // format of the input field
	displayArea    :    "show_Date1",         // ID of the span where the date is to be shown
	daFormat       :    "%A %e %B %Y %H:%M",  // format of the displayed date
    button         :    "f_trigger_c1",       // trigger for the calendar (button ID)
    align          :    "Tl",                 // alignment (defaults to "Bl")
	date		   :	"", 				  // date affichee par defaut
    singleClick    :    true,
	dateStatusFunc :	dateStatusHandler     // pour afficher des dates speciales differemt (jours feries)
											  // et d'en desactiver (en fonction du planning de l'Actor
    });

// ]]>
</script>
{/literal}
		</td>
	</tr>
	</tbody>
	<thead>
	<tr>
		<td colspan="4" align="left">{t}Command summary{/t}</td>
	</tr>
	</thead>
  </table>
  <p>{$gridRender}
  <table class="form" width="100%" cellspacing="0" cellpadding="3" border="0">
	<tr>
		<td nowrap="nowrap" width="15%"><strong>{$form.Port.label} {$Currency} : </strong></td>
		<td nowrap="nowrap" width="20%">{$form.Port.html}</td>
		<td nowrap="nowrap" width="15%"><strong>{t}Customer discount{/t} % :</strong>&nbsp;</td>
		<td nowrap="nowrap" width="20%">
			<input type="text" size="10" name="RemExcep" class="ReadOnlyField" value="{$remExcep}" readonly="readonly" /></td>
		<td nowrap="nowrap" width="15%"><strong>{t}Amount excl. VAT{/t} {$Currency} : </strong></td>
		<td nowrap="nowrap" width="15%"><input type="text" size="15" name="TotalHT" class="ReadOnlyField" readonly="readonly" /></td>
	</tr>
	<tr>
		<td  nowrap="nowrap"><strong>{$form.Emballage.label} {$Currency} : </strong></td>
		<td>{$form.Emballage.html}</td>
		<td>{if $TvaSurtaxRate neq '0'} <strong>{t}VAT surtax{/t}&nbsp;% :</strong>{/if}&nbsp;
		    {if $FodecTaxRate neq '0'} <br /><strong>{t}FODEC tax{/t}&nbsp;{$FodecTaxRateFormated} % :</strong>{/if}&nbsp;
		    {if $TaxStamp neq '0'} <br /><br /><strong>{t}Tax stamp{/t}&nbsp;{$Currency} :</strong>{/if}&nbsp;
		</td>
		<td>{if $TvaSurtaxRate neq '0'} 
		      <input type="text" size="10" name="tvaSurtax" class="ReadOnlyField" readonly="readonly" value="{$TvaSurtaxRateFormated}" />
            {else}<input type="hidden" name="tvaSurtax" value="0" />&nbsp;
            {/if}
            {if $FodecTaxRate neq '0'} 
		      <br /><input type="text" size="10" name="fodecTax" class="ReadOnlyField" readonly="readonly" value="0" />
            {else}<input type="hidden" name="fodecTax" value="0" />&nbsp;
            {/if}
            {if $TaxStamp neq '0'} <br /><br /><input type="text" size="10" name="taxStampFormated" class="ReadOnlyField"
                readonly="readonly" value="{$TaxStampFormated}" />	
            {/if}
        </td>
		<td nowrap="nowrap"><strong>{t}Amount incl. VAT{/t} {$Currency} : </strong></td>
		<td nowrap="nowrap"><input type="text" size="15" name="TotalTTC" class="ReadOnlyField" readonly="readonly" /></td>
	</tr>
	<tr>
		<td  nowrap="nowrap"><strong>{$form.Assurance.label} {$Currency} : </strong></td>
		<td colspan="3">{$form.Assurance.html}</td>
		<td nowrap="nowrap"><strong>{$form.Instalment.label} {$Currency} : </strong></td>
		<td nowrap="nowrap">{$form.Instalment.html}</td>
	</tr>
	<tr>
		<td colspan="4"></td>
		<td nowrap="nowrap"><strong>{$form.InstalmentModality.label} : </strong></td>
        <td nowrap="nowrap">{$form.InstalmentModality.html}</td>
	</tr>
	<tr>
		<td  nowrap="nowrap"><strong>{$form.GlobalHanding.label} % : </strong></td>
		<td colspan="3">{$form.GlobalHanding.html}</td>
		<td nowrap="nowrap"><strong>{t}To pay{/t} {$Currency} :   </strong></td>
		<td nowrap="nowrap"><input type="text" size="15" name="ToPay" class="ReadOnlyField" readonly="readonly" /></td>
	</tr>
  </table>
  </p>
  <table style="width:100%;" border="0" cellpadding="3" cellspacing="0" class="form">
    <thead>
    <tr>
      <td colspan="2">{$form.cmdComment.label}</td>
    </tr>
	</thead>
	<tbody>
    <tr>
      <td colspan="2" height="80">{$form.cmdComment.html}</td>
    </tr>
	</tbody>
	<tfoot>
    <tr>
      <td align="right" colspan="2">
        <input name="valider" type="submit" onclick="formSubmitted.value='true'"
          value="{t}Ok{/t}" class="Button" />
		&nbsp;
        <input name="annuler" type="button" onclick="window.location='{$returnURL}'"
          value="{t}Cancel{/t}" class="Button" />
      </td>
    </tr>
	</tfoot>
</table>
